<?php

namespace co2\v0_0_0\Cypher;

class Passphrase

{
	protected
		$passphrase
		;
		
	public function
	__construct
	(
		$length=64
	)
	
	{
		$opt=array
		(
			range('a','z'),
			range('A','Z'),
			range(0,9),
			explode(' ','~ ` ! @ # $ % ^ & * ( ) - _ + = { } [ ] : ; < > , . / ? |')
		);
		
		for
		(
			$passphrase='';
			strlen($passphrase)<=$length;
			$use=$opt[rand(0,3)],
			$passphrase.=$use[rand(0,(count($use)-1))]
		);
		
		$this->passphrase=$passphrase;
	}
	
	public function
	__toString
	(
	
	)
	{
		return $this->passphrase;
	}
}
